package two_xia.ex9.Demo05;

class WHO extends UnitedNations {
    private China china;
    private USA usa;

    public void setChina(China china) {
        this.china = china;
    }

    public void setUSA(USA usa) {
        this.usa = usa;
    }

    @Override
    public void declare(String message, Country country) {
        if (country == china) {
            usa.receiveMessage(message);
        } else {
            china.receiveMessage(message);
        }
    }
}